<template>
  <van-goods-action>
    <van-goods-action-icon
      :icon="star ? 'star' : 'star-o'"
      :text="star ? '已收藏' : '收藏'"
      @click="star = !star"
    />
    <van-goods-action-icon
      icon="cart-o"
      text="购物车"
      @click="$router.push('/cart')"
      :badge="goodsCount"
    />
    <van-goods-action-button
      type="danger"
      text="立即购买"
      @click="$toast('功能暂未开放')"
    />
    <van-goods-action-button
      type="warning"
      text="加入购物车"
      @click="$emit('showSku')"
    />
  </van-goods-action>
</template>

<script>
export default {
  props: ['goodsCount'],
  data () {
    return {
      star: false
    }
  }
}
</script>

<style lang='less' scoped>
.van-goods-action {
  z-index: 9999999;
}
</style>
